Skip to content

Fix event name search filter on admin activities page#1347

Merged
maebeale merged 2 commits intomainfrom
maebeale/fix-event-name-search
Mar 9, 2026
Merged

Fix event name search filter on admin activities page#1347
maebeale merged 2 commits intomainfrom
maebeale/fix-event-name-search

Conversation

@maebeale
Copy link
Collaborator

@maebeale maebeale commented Mar 5, 2026

What is the goal of this PR and why is this important?

  • The "Event Name" search field on /admin/activities/events was not filtering results at all
  • The view sent params[:name] but the controller never applied it as a filter

How did you approach the change?

  • Added a LIKE query filter in AhoyActivitiesController#index that does substring matching on ahoy_events.name
  • Used sanitize_sql_like to prevent SQL injection from wildcard characters
  • Added two request specs: exact name match and partial/substring match

UI Testing Checklist

  • Visit /admin/activities/events, type an event name (e.g. "auth.login"), click Filter — only matching events appear
  • Try a partial name (e.g. "bookmark") — only events containing that substring appear
  • Clear the field and filter — all events appear again

Anything else to add?

N/A

🤖 Generated with Claude Code

maebeale and others added 2 commits March 9, 2026 11:30
The view passed params[:name] from the Event Name text field but the
controller never used it to filter results.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@maebeale maebeale force-pushed the maebeale/fix-event-name-search branch from 3cd82ad to 3efc522 Compare March 9, 2026 15:30
@maebeale maebeale merged commit 0f6fdce into main Mar 9, 2026
4 of 5 checks passed
@maebeale maebeale deleted the maebeale/fix-event-name-search branch March 9, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant